import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询列表
export function list (query) {
    return request({
        url: '/manage/deviceUpkeep/devicePage',
        method: 'get',
        params: query
    })
}

// 详情
export function getById (query) {
    return request({
        url: '/manage/deviceUpkeep/getById/' + query.id,
        method: 'get',
        params: query
    })
}

// 新增
export function add (data) {
    return request({
        url: '/manage/deviceUpkeep/add',
        method: 'post',
        data: data
    })
}

// 修改
export function edit (data) {
    return request({
        url: '/manage/deviceUpkeep/edit',
        method: 'put',
        data: data
    })
}

// 删除
export function deleteById (data) {
    return request({
        url: '/manage/deviceUpkeep/deleteById/' + data.id,
        method: 'delete',
        data
    })
}

// 根据设备编号或者设备名称获取设备列表
export function getListBydeviceUpkeepNameOrdeviceUpkeepNum (query) {
    return request({
        url: '/manage/deviceUpkeep/getListBydeviceUpkeepNameOrdeviceUpkeepNum',
        method: 'get',
        params: query
    })
}

// 根据id获取维修设备信息
export function getInfoById (id) {
    return request({
        url: '/manage/deviceUpkeep/getInfoById/' + id,
        method: 'get'
    })
}